package burubaka.controller.top;

import java.util.logging.Logger;

import org.slim3.controller.Navigation;

import burubaka.common.controller.Controller;
import burubaka.service.RaceInfoService;

public class TopController extends Controller {

	private static final Logger log = Logger.getLogger(TopController.class.getName());
	private RaceInfoService raceInfoService = new RaceInfoService();

	@Override
	public Navigation init() throws Exception {

		// レース情報取得
		String raceInfoJSON = raceInfoService.getCurrentRaceForJSON();
		log.fine(raceInfoJSON);
		response.setContentType("application/json; charset=UTF-8");
		response.getWriter().write(raceInfoJSON);
		response.getWriter().flush();

		return null;
	}
}
